Home   Help Search Login Register  

Author Topic: Altering death scenes  (Read 1132 times)

0 Members and 1 Guest are viewing this topic.

funkster

  • Guest
Altering death scenes
« on: 06 Sep 2005, 11:27:15 »
Hiya,

I am working on a mission (duh!) and I want to alter the death scene (if the player is killed) - I want to add custom music.
I know that you can edit these scenes, because mcguba changed the views in his "unimpossible mission" so that the view was from the enemy's perspective, and he did that very nicely I must say. So no doubt it cant be to hard to force it to play my music track right....

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Altering death scenes
« Reply #1 on: 06 Sep 2005, 11:35:53 »
If you've got UnImpossible the critical file is onplayerkilled.sqs which is called automatically when the player dies.   After that it's basically just a normal cutscene with one or two special wrinkles.    Music is exactly the same as music in an Intro or cutscene.

The one giving the view from the perspective of the guy who shot you is by Sui, I just borrowed it with permission.
Plenty of reviewed ArmA missions for you to play

Offline 456820

  • Contributing Member
  • **
Re:Altering death scenes
« Reply #2 on: 06 Sep 2005, 12:08:32 »
i made a tutorial about the onplayerkilled.sqs script its in the pending section
my internets being a bit weird so i cant got a link so ill copy and past the tut

here it is
Quote
i have noticed there are no custom death cam tutorials so i decided to make one and here it is

Skills needed
be able to camera script (cant use the camera.sqs though.)
DONT READ ON IF YOU CANT CAMERA SCRIPT

What is it
the onplayerkilled.sqs runs when the player is killed and is used to make custom death cams
for example if i die and i want to create a camera and film the player diying and falling to the floor this is what you need.

Getting started
okay create a file called
onplayerkilled.sqs
and in that you can put your script must be a camera script like this

TitleCut ["","WHITE IN",1]
_camera = "camera" CamCreate [0,0,0]
_camera CameraEffect ["INTERNAL","FRONT"]

_camera CamSetTarget (vehicle player)
_camera CamSetRelPos [+8,+5,+5]
_camera CamSetFov 0.250
_camera CamCommit 0
~1

okay if you know how to camera script you should understand this and should be able to make their own script easily

Things you need to know
things you need to know are
- this can work like an event handler in ways such as
_this select 0 is the person who died

_this select 1 is the person who killed the player so to target the killer put this at the begining

killer = _this select 1
and to target it use
_camera CamSetTarget killer

also to show the end dialog wich must be done so people can exit the the game or retry use
EnableEndDialog
i supose it might be possible to DisableEndDialog but ive never tried it.

I think thats it for this, if anything i may have forgotten please mention.
Hope this helps some people to personlise their own mission more

EDIT - If you have seen one of these where it shows the player fall down as they get shot you need a trigger activating the script (well thats to my knowldege)
have the trigger to not present player over the whole map
and rename the script to somethig else this only activated once the player has hit the floor and it blacks out

thats it

hope it helps

and yeah just use playmusic "music name"

that will play the track and that remins me got to add an edit to the tut it just says that it does not have any music with it so if you want music you in the script you must use BIS music or use your own and if you want you can use none

hope it helps

funkster

  • Guest
Re:Altering death scenes
« Reply #3 on: 07 Sep 2005, 00:50:28 »
Thanks guys, that helps heaps.

However, I still have a couple of issues:

1) I dont really want to alter the camera shots nessasarily (although maybe now i will 8) ), so is there a way I can call the default BIS onplayerkilled script and alter it? No biggy if not, ill just have to script cameras as well.

2) I just want to add one custom music track, and I want there to be around a 50% chance of playing the track, but also for variety it will sometimes play default BIS tracks.

So, is there a way i can have

if (random 100>50) then (playMusic "rrh") else ("play default track selections")  ?
Or do I have to go and declare all of these tracks myself?

3) BTW - This brings me to another issue (sorry, just remembered this)
When I want to call a BIS music track or sound in a script, is there a way I can call them without having to declare them in description.ext ? If so, where can I get a list of all the sounds?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Altering death scenes
« Reply #4 on: 07 Sep 2005, 11:23:48 »
There are two different default BIS camera scripts.  They are chosen randomly.  

Make your own onplayerkilled.sqs.  Copy in the BIS camerawork of your choice.

You random code will work fine, subject to the syntax being ok.   onplayerkilled is just an ordinary script file, you can do all the usual stuff in it.

You don't need to define BIS music in description.ext.   Just use the playmusic command.  

List of tracks couresty of Blanco here
Plenty of reviewed ArmA missions for you to play

Offline 456820

  • Contributing Member
  • **
Re:Altering death scenes
« Reply #5 on: 07 Sep 2005, 17:15:10 »
also original Bis onplayerkilled scripts can be founf under scripts.pbo in your Dta folder or it may be
anim.pbo

i think its one of those i may be wrong but its in one of the .pbo files in the DTA folder

funkster

  • Guest
Re:Altering death scenes
« Reply #6 on: 08 Sep 2005, 00:52:48 »
Great!
Thank you both very much!

So now, all I have to do is

playsound "Rus8"

OR

playmusic "track1"

to use this stuff huh? That's really helpful...   :D

----------------------------------------------------------------------------

EDIT:

Forgot to add, I cant get the camera to target the "killer" - _this select 1 does not seem to work. Here is my script:

Quote
; Dead, this scene will be called when the player dies, it will watch them die in slow motion, play custom music
; then show the person who killed them. Then it will zoom  high over the map.


killer = _this select 1

EnableEndDialog

playMusic "dftr"

TitleCut ["","WHITE IN",1]
_cam = "camera" CamCreate [0,0,0]
_cam CameraEffect ["INTERNAL","FRONT"]

_cam CamSetTarget (vehicle player)
_cam CamSetRelPos [3,10,3]
_cam CamSetFov 0.350
_cam CamCommit 0

setAccTime 0.3

~ 3

_cam camSetTarget player
_cam camSetRelPos [0, 5, 1]
_cam camSetFOV 0.9
_cam CamCommit 3

~ 3


setAccTime 1

_cam camSetTarget killer
_cam camSetRelPos [0, 5, 1]
_cam camSetFOV 0.7
_cam CamCommit 8


~ 9

_cam camSetRelPos [1, 1, 100]
_cam CamCommit 30

~ 31

#loop


_cam CamSetTarget (vehicle player)
_cam CamSetRelPos [1,1,10]
_cam CamSetFov 0.350
_cam CamCommit 15

~ 16

_cam camSetTarget killer
_cam camSetRelPos [1, 1, 10]
_cam CamCommit 15

~ 16

_cam camSetRelPos [1, 1, 100]
_cam CamCommit 30

~ 31

goto "loop"

The problem is, the camera cycles between the different RelPos's, but always the player stays the target.

There is no error message, except once it briefly said something about _this select 1, and some wierd "dividable, divided" or something...I dont know, I missed it...
---------------------------------------------

EDIT TWO:

The error message i get is

"error: killer = _this select 1; zero divisor" or something along those lines...
« Last Edit: 08 Sep 2005, 09:20:11 by funkster »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Altering death scenes
« Reply #7 on: 08 Sep 2005, 17:05:57 »
Try

_killer

throughout, although it shouldn't make any difference.  

This script is called onplayerkilled.sqs, right?
Plenty of reviewed ArmA missions for you to play

junkie-xL

  • Guest
Re:Altering death scenes
« Reply #8 on: 08 Sep 2005, 19:13:58 »
there is an excellent mission in OFPEC's database by one of the classics (Sui?)

it features a custom onplayerkilled.sqs that doesn't reveal the enemies' position, which in fact makes a mission much more fun

can't remember the name, but it has a hilarious intro in which you have to remove mines and one of your buddies screws up one of the mines

one should wish to see more of these custom "you're dead" screens

(if only to change the standard music that must have caused braindamage to all of us by now)

EDIT: the mission is indeed by Sui: Facile Ground and it's a good example of how the death screen can be altered
« Last Edit: 09 Sep 2005, 00:25:38 by junkie-xL »

funkster

  • Guest
Re:Altering death scenes
« Reply #9 on: 09 Sep 2005, 08:23:00 »
ok, thanks for replies.

No, the script is actually not "onplayerkilled.sqs", I started out calling it dead, and using a trigger to activate it when you die, so I could do the slow-mo death thing. As it turns out, the BIS onplayerkilled kicks in once you hit the ground, thus wiping out my music! SO I will have to call it that now - maybe itl work. Post result in a min...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Altering death scenes
« Reply #10 on: 09 Sep 2005, 13:15:49 »
You must have a script called onplayerkilled.sqs:   there is no alternative.   However you can use it to call other scripts or whatever you like.    

The wrong name is why it isn't working.
Plenty of reviewed ArmA missions for you to play

funkster

  • Guest
Re:Altering death scenes
« Reply #11 on: 11 Sep 2005, 04:06:12 »
thanks macugba,
I did actually have an "onplayerkilled.sqs" , it was just called from within another script. As it turns out, you are right,
you have to have the onplayerkilled execute first.

All fixed, thanks a mill!! 8)